package test2;

public class demo85 {

    /*
     * public class TreeNode {
     *   int val = 0;
     *   TreeNode left = null;
     *   TreeNode right = null;
     *   public TreeNode(int val) {
     *     this.val = val;
     *   }
     * }
     */

/*    public class Solution {

        private LinkedList<Integer> list = new LinkedList<>();
        public int[] preorderTraversal (TreeNode root) {
            preOrder(root);
            int[] res = new int[list.size()];
            for(int i = 0;i<list.size();i++)
            {
                res[i] = list.get(i);
            }
            return res;
        }
        List<Integer> preOrder(TreeNode root){
            if(root == null){
                return list;
            }
            list.add(root.val);
            preOrder(root.left);
            preOrder(root.right);

            return list;
        }
    }*/
}
